var monedas = {
		init:function(){
			var moneda = this;
			$('#monedas').jqGrid({
	           url:'monedas/index',
	           datatype:'json',
	           mtype:'POST',
	           colNames:['id','Simbolo','Nombre','Creado','Estado'],
	           colModel:[
	               {name:"data[Moneda][id]",hidden:true},
	               {name:"data[Moneda][simbolo]",index:'Moneda.simbolo',width:50,align:'left',sortable:true,editable:true,editoptions:{maxlength:3},editrules:{required:true},searchoptions:{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew']}},
				   {name:"data[Moneda][nombre]",index:'Moneda.nombre',width:250,align:'left',sortable:true,editable:true,editoptions:{maxlength:20, size:25},editrules:{required:true},searchoptions:{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew']}},
	               {name:"data[Moneda][created]",index:'Moneda.created',width:60,align:'left',sortable:true,editable:false,searchoptions:{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew']}},
	               {name:"data[Moneda][estado_id]",index:'Estado.descripcion',width:60,	align:'left',editable: true,edittype:"select",editoptions:{value:"1:Activo;2:Desactivo"},searchoptions:{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew']}}               
	           ],
			   pager:$('#monedas-pager'),
	           rowNum:10,
	           rowList:[10,20,30],
	           mtype: "POST",
	           viewrecords:true,
	           caption:'monedas',
	           height:'180',
	           sortname: "Moneda.nombre",
	           editurl: 'monedas/index'       
	       });
	       
		  $('#monedas').navGrid("#monedas-pager",{edit:true,add:true,del:true},
			{clearAfterEdit:false,reloadAfterSubmit:true, closeOnEscape:true, afterSubmit:moneda.afterSubmit},
			{clearAfterAdd:true,reloadAfterSubmit:true, closeOnEscape:true,afterSubmit:moneda.afterSubmit},
			{width:270,reloadAfterSubmit:true,closeOnEscape:true},
			{sopt:['cn','eq','ne','lt','le','gt','ge','bw','ew'],multipleSearch:true,closeOnEscape:true});
	       
		   $("#monedas").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false});
	       jQuery("#monedas").jqGrid('setGridWidth',$('#RightPane').width()-50);
		},
		//afterSubmit: function(response){var respuesta = JSON.parse(response.responseText); return [respuesta.respuesta,respuesta.mensaje];}
};